<?php
/**
 * Created by JetBrains PhpStorm.
 * User: cgp
 * Date: 13-4-6
 * Time: 上午11:38
 * To change this template use File | Settings | File Templates.
 */
if(!defined('ROOTPATH')) {
    define('ROOTPATH','/var/www/html/new/');
    define('CLASSPATH',ROOTPATH .'d/class/');
    define('TPLPATH',ROOTPATH .'d/tpl/');
    define('COMMONPATH',ROOTPATH .'d/common/');
    define('PROD_IMG_PATH',ROOTPATH .'d/prodimgs/');
}
$includedFiles = get_included_files();
if( !in_array(ROOTPATH . 'com.inc.php', $includedFiles) ){
    include ROOTPATH . 'com.inc.php';
}
if( !in_array(ROOTPATH . 'd/common/func.inc.php', $includedFiles)) {
    include ROOTPATH . 'd/common/func.inc.php';
}

if(!class_exists('go_sql')) {
    include ROOTPATH.'conf/le.je';
    $le = new go_sql();
    $le->connect();
}
function _mysql_insert_id(){
    $sl = 'SELECT LAST_INSERT_ID() as lastid';
    $GLOBALS['le']->query($sl);
    $GLOBALS['le']->fetch_assoc();
    $lastid = $GLOBALS['le']->f('lastid');
    return $lastid;
}
function cgp_autoload($class) {
    $parts = explode('\\', $class);
    $class = end($parts);
    //require end($parts) . '.php';
    if(is_file(CLASSPATH.$class.'.class.php')) {
        //echo CLASSPATH.$class.'.class.php';
        include(CLASSPATH.$class.'.class.php');
        return true;
    }
    return false;
}

spl_autoload_register('cgp_autoload');
$web_title = '票付通';